# Maintainer: Luca Weiss <luca@lucaweiss.eu>
pkgname=click
pkgver=0.5.2
pkgrel=3
pkgdesc="Simplified packaging format"
url="https://gitlab.com/ubports/development/core/click"
arch="all"
license="GPL-3.0-only"
depends_dev="
	dbus-test-runner-dev
	gobject-introspection-dev
	gtest-dev
	libgee-dev
	process-cpp-dev
	properties-cpp-dev
	"
makedepends="
	$depends_dev
	autoconf
	automake
	cmake
	dbus-test-runner
	gobject-introspection
	intltool
	json-glib-dev
	libtool
	py3-setuptools
	vala
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-pyc"
source="https://gitlab.com/ubports/development/core/click/-/archive/$pkgver/click-$pkgver.tar.gz
	0001-configure.ac-fix-building-against-BusyBox-sed.patch
	0002-gcc14-preload-fix-implicit-function-declaration.patch
	"
options="!check" # Needs dpkg

build() {
	./autogen.sh
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-packagekit \
		--disable-systemd
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir/" PYTHON_INSTALL_FLAGS="--root=$pkgdir/" install

	# Make abuild's version check happy (#386)
	sed -i s/+ubports//g "$pkgdir"/usr/lib/pkgconfig/*.pc
}

sha512sums="
56244d2baa71bbfc168f57e4eea30a5ee0bde6da6e92e2063ede97d2ef93d44123a1af7a0c1610090ae48a9cf77e2daa554e9407454b7f8f53d1f655956e9cb0  click-0.5.2.tar.gz
40cf041438fae2a916c4277ebedca005338c011697248b69568b49559fe7f2a482199eeafe7704b54e73cf5e85c6c78022c750e29efc083aef1e7213314b3e34  0001-configure.ac-fix-building-against-BusyBox-sed.patch
6deb7c93f0e617444cf1e9343b58d57e109f764a1f0198ad61cfcbf95c759d2c0e0a94e750f48c4ac1ef72fb788c691b54915205ed6b41c442620f1932f149c3  0002-gcc14-preload-fix-implicit-function-declaration.patch
"
